﻿@using Microsoft.AspNetCore.Identity
@using Microsoft.AspNetCore.Mvc.Localization
@using Microsoft.Extensions.Options
@inject IViewLocalizer Localizer
@model Skoruba.IdentityServer4.STS.Identity.ViewModels.Account.ForgotPasswordViewModel
@inject IOptions<IdentityOptions> IdentityOptions
@{
    ViewData["Title"] = Localizer["Title"];
}

@await Html.PartialAsync("_ValidationSummary")

<h1>@ViewData["Title"]</h1>
<hr />
<form asp-controller="Account" asp-action="ForgotPassword" method="post">
    <div class="row">
        <h4>@Localizer["ChoosePolicy"]</h4>
        <div class="form-group">

            @if (IdentityOptions.Value.User.RequireUniqueEmail)
            {
                <span class="col-md-4">
                    <input type="radio" asp-for="Policy" value="Email" />Email
                </span>
            }

            <span class="col-md-4">
                <input type="radio" asp-for="Policy" value="Username" />Username
            </span>
        </div>
    </div>
    <div class="row">

        <div class="col-md-4 resetPasswordBy" id="resetPasswordByEmail">
            <div class="form-group">
                <label asp-for="Email">@Localizer["Email"]</label>
                <input asp-for="Email" class="form-control" />
                <span asp-validation-for="Email" class="text-danger"></span>
            </div>
            <button type="submit" class="btn btn-primary">@Localizer["Submit"]</button>

        </div>

        <div class="col-md-4 resetPasswordBy" id="resetPasswordByUsername">
            <div class="form-group">
                <label asp-for="Username">@Localizer["Username"]</label>
                <input asp-for="Username" class="form-control" />
                <span asp-validation-for="Username" class="text-danger"></span>
            </div>
            <button type="submit" class="btn btn-primary">@Localizer["Submit"]</button>
        </div>

    </div>
</form>

@section scripts {

    <script src="~/js/forgot-password.js">
    </script>
}